﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using System.IO;
using KPIS.GERP.ESS.BLL;
using KPIS.GERP.ESS.MODEL;
using _WebShared.Classes;
using KPIS.GERP.ESS.APP.App_UI.Commons;

namespace KPIS.GERP.ESS.APP.App_UI.Forms
{
    public partial class ESS_MoneyReturnHistorys : System.Web.UI.Page
    {
        Main main = new Main();
        FIM_MoneyReturns.FIM_MoneyReturns re = new FIM_MoneyReturns.FIM_MoneyReturns();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int year = main.GetSystemControls().default_bgm_year.Value;
                txtBgmYear.Text = year.ToString();
                txtBgmYear.MinValue = year - 10;
                txtBgmYear.MaxValue = year + 1;
            }
        }

        protected void LoadRadGrid1()
        {
            RadGrid1.DataSource = re.GetFull(null, null, null, null, Session["EmpSeq"].ToString(), null, false);
        }

        protected void UpdateUI1(string strCommand)
        {
            //switch (strCommand)
            //{
            //    case "ViewAll":
            //    case "Insert":
            //    case "Update":
            //        cmdViewAll1.Visible = false;
            //        cmdAddNew1.Visible = true;
            //        cmdAddNew12.Visible = true;
            //        cmdEdit1.Visible = true;
            //        cmdDelete1.Visible = true;
            //        cmdInsert1.Visible = false;
            //        cmdUpdate1.Visible = false;

            //        PanelRadGridBanks.Visible = true;
            //        PanelEditBanks.Visible = false;
            //        break;
            //    case "AddNew":
            //        cmdViewAll1.Visible = true;
            //        cmdAddNew1.Visible = false;
            //        cmdAddNew12.Visible = false;
            //        cmdEdit1.Visible = false;
            //        cmdDelete1.Visible = false;
            //        cmdInsert1.Visible = true;
            //        cmdUpdate1.Visible = false;

            //        PanelRadGridBanks.Visible = false;
            //        PanelEditBanks.Visible = true;
            //        break;
            //    case "Edit":
            //        cmdViewAll1.Visible = true;
            //        cmdAddNew1.Visible = false;
            //        cmdAddNew12.Visible = false;
            //        cmdEdit1.Visible = false;
            //        cmdDelete1.Visible = false;
            //        cmdInsert1.Visible = false;
            //        cmdUpdate1.Visible = true;

            //        PanelRadGridBanks.Visible = false;
            //        PanelEditBanks.Visible = true;
            //        break;
            //}
        }
        
        ////============================ control events ==============================

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                LoadRadGrid1();
            }
        }

        //==========================================================================
    }
}
